/* --- 0. IMPORTATION DES POLICES --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&family=Playfair+Display:wght@700;800&family=Inter:wght@300;400;500;600&display=swap');

/* --- 1. CONFIGURATION DE BASE & COULEURS --- */
:root {
    /* Couleurs de base (inchangées) */
    --primary-blue: #0A1172;
    --ultramarine: #120a8f;
    --glow: #4169e1;
    --gold: #FFD700;
    --white: #ffffff;
    
    /* Polices */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-accent: 'Poppins', sans-serif;

    /* Variables DARK MODE (par défaut) */
    --bg-primary: #000000;
    --bg-secondary: #0a0a1a;
    --bg-tertiary: rgba(255, 255, 255, 0.03);
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #b0b0b0;
    --border-color: rgba(255, 215, 0, 0.15);
    --card-bg: rgba(10, 17, 114, 0.7);
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-text: #ffffff;
    --label-color: #ffffff;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --section-gap: 80px;
    
    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
}

/* Variables LIGHT MODE */
body.light-mode {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: rgba(10, 17, 114, 0.05);
    --text-primary: #1a1a2e;
    --text-secondary: #333333;
    --text-tertiary: #666666;
    --border-color: rgba(10, 17, 114, 0.1);
    --card-bg: rgba(255, 255, 255, 0.95);
    --input-bg: #ffffff;
    --input-text: #1a1a2e;
    --label-color: #0A1172;
    
    --shadow-sm: 0 4px 12px rgba(10, 17, 114, 0.1);
    --shadow-md: 0 10px 30px rgba(10, 17, 114, 0.15);
    --shadow-lg: 0 20px 50px rgba(10, 17, 114, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- 2. EN-TÊTE (HEADER) --- */
header {
    background-color: transparent;
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    transition: all 0.3s ease;
}

header.scrolled {
    background-color: rgba(10, 17, 114, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.8rem 5%;
    box-shadow: var(--shadow-md);
}

body.light-mode header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.header-hidden {
    transform: translateY(-100%);
}

/* Texte sur hero non scrollé (reste blanc) */
body.light-mode header:not(.scrolled) nav a,
body.light-mode header:not(.scrolled) .logo span {
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

body.light-mode header.scrolled nav a,
body.light-mode header.scrolled .logo span,
body.light-mode header.scrolled nav a i {
    color: var(--ultramarine);
}

/* --- TYPOGRAPHIE GLOBALE --- */
h1, h2, h3, h4, .section-title {
    font-family: var(--font-heading);
    font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.2; }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); line-height: 1.3; margin-bottom: var(--spacing-md); }
h3 { font-size: clamp(1.25rem, 2vw, 2rem); }
h4 { font-size: 1.2rem; }

/* Logo */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-xs);
}

.logo img {
    height: 80px;
    width: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--gold);
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.logo span {
    color: var(--glow);
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- ANIMATION MACHINE À ÉCRIRE --- */
.typewriter-cursor::after {
    content: '|';
    margin-left: 2px;
    color: var(--gold);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

nav ul {
    display: flex;
    gap: 20px;
}

nav a {
    font-family: var(--font-accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 5px 10px;
}

nav a i {
    font-size: 1.3rem; /* Agrandit les icônes par rapport au texte original */
}

nav a:hover, nav a.active {
    color: var(--glow);
    border-bottom: 2px solid var(--gold);
}

/* --- 3. SECTION ACCUEIL (HERO) --- */
.hero {
    height: 80vh; /* Réduit un peu la hauteur pour laisser entrevoir la suite */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Recentrage vertical (position initiale) */
    align-items: center; /* Aligne le contenu au centre */
    text-align: center;
    padding: 0 20px;
    position: relative;
    z-index: 10; /* Force le Hero à rester au-dessus des débordements de lumière des sections suivantes */
    overflow: hidden;
    margin-top: 0; /* S'assure que le hero commence tout en haut */
}

/* Image de fond avec Zoom In/Out */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/fond-connexion.jpeg') no-repeat center center/cover;
    z-index: -2;
    animation: zoomInOut 20s infinite alternate;
}

/* Filtre sombre pour la lisibilité du texte */
.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

/* Retirer l'image de fond et le filtre pour les en-têtes des sous-pages (À Propos / Équipe) */
body.sub-page .hero::before,
body.sub-page .hero::after,
body.login-page .hero::before,
body.login-page .hero::after {
    display: none;
}

.hero h2 {
    font-size: 3rem; /* Retour taille initiale */
    margin-bottom: 20px;
    white-space: normal; /* Permet au texte de revenir à la ligne */
    width: 100%; /* Prend toute la largeur pour passer derrière l'image */
    max-width: 800px; /* Limite la largeur pour une meilleure lecture */
    margin-right: 0;
    border-right: none;
}

/* Style pour le texte sous le titre (paragraphe) */
.hero p {
    font-family: var(--font-accent);
    font-size: 1.5rem; /* Retour taille initiale */
    color: var(--white);
    white-space: normal; /* Permet au texte de revenir à la ligne */
    width: 100%;
    max-width: 800px;
    margin-right: 0;
}

.btn-cta {
    position: relative;
    font-family: var(--font-accent);
    background-color: var(--gold);
    color: var(--primary-blue);
    padding: 14px 35px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    display: inline-block;
    overflow: visible;
}

.btn-cta:hover {
    background-color: transparent;
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Subtle glowing halo for CTA */
.btn-cta::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 12px;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(255,215,0,0.12), transparent 40%);
    opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
}
.btn-cta:hover::after { opacity: 1; transform: scale(1.02); }

body.light-mode .btn-cta:hover {
    background-color: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* --- IMAGE ÉLÈVE HERO --- */
.hero-student-img {
    position: absolute;
    bottom: 0;
    right: 0; /* Déplace l'image à droite pour libérer le logo à gauche */
    left: auto;
    transform: none;
    height: 65vh; /* Taille réduite pour ne pas masquer le logo */
    width: auto;
    max-width: 60vw;
    object-fit: contain; /* Garde les proportions de l'image */
    object-position: bottom right; /* Ancre l'image en bas à droite */
    z-index: 10; /* L'image de l'élève passe au premier plan */
    animation: slideUpFade 1.5s ease-out forwards;
    pointer-events: none; /* Permet de cliquer à travers l'image si besoin */
}

/* Le texte passe désormais derrière l'image de l'élève */
.hero h1, .hero h2, .hero p, .hero-scroll-container { position: relative; z-index: 5; text-align: center; }

/* Le bouton reste au premier plan pour être toujours cliquable et visible */
.hero .btn-cta { position: relative; z-index: 15; }

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 4. CONTENEURS DE SECTION --- */
section {
    padding: 100px 10% 80px; 
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gold);
    margin: 10px auto 0;
}

/* --- 5. À PROPOS --- */
.about-content {
    position: relative;
    padding: 50px;
    border-radius: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
    overflow: hidden;
    z-index: 1;
    background: transparent;
    border: none;
    margin-bottom: 30px;
}

.about-text { flex: 1; min-width: 300px; }
.about-img { 
    flex: 1; 
    min-width: 300px; 
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-img:hover img { transform: scale(1.05); }

/* Style Liste Mission */
.mission-list {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    text-align: left;
}

.mission-list li {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 3px solid var(--gold);
    transition: 0.3s;
}

.mission-list li:hover {
    background: rgba(65, 105, 225, 0.1);
    transform: translateX(10px);
}

/* --- 6. FORMATIONS --- */
.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
    /* Modifs Hi-Tech */
    background: transparent;
    padding: 3px;
    z-index: 1;
    border: none;
    position: relative;
}

/* Soft luminous border using a pseudo-element so the actual card bg stays intact */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(65,105,225,0.12), rgba(255,215,0,0.06));
    box-shadow: 0 8px 30px rgba(2,6,23,0.25) inset;
    filter: blur(6px);
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

/* Glow effect on hover */
.card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 12px 40px rgba(65,105,225,0.10), 0 8px 30px rgba(255,215,0,0.05);
}
.card:hover::before {
    opacity: 1;
    transform: scale(1.02);
    filter: blur(8px);
}

/* Stronger, Instagram-like glow for news cards */
.news-grid .card::before {
    background: linear-gradient(135deg, rgba(65,105,225,0.2), rgba(255,215,0,0.12));
}
.news-grid .card:hover {
    box-shadow: 0 18px 60px rgba(65,105,225,0.14), 0 10px 40px rgba(255,215,0,0.07);
}

/* Respect user's reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .card, .card::before {
        transition: none !important;
        transform: none !important;
        filter: none !important;
    }
    .card:hover { transform: none; box-shadow: none; }
}


.card-header {
    font-family: var(--font-heading);
    background-color: rgba(10, 17, 114, 0.9);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.card-body { padding: 20px; }
.card-body ul { list-style-type: disc; margin-left: 20px; }

/* --- 7. ALBUM (GALLERY) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-item {
    height: 200px;
    background-color: #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.gallery-item .category-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--gold);
    color: var(--primary-blue);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 5;
}

.gallery-item::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(65,105,225,0.06), rgba(255,215,0,0.04));
    opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-item:hover::before { opacity: 1; transform: scale(1.02); filter: blur(4px); }

.gallery-item:hover img { transform: scale(1.1); }

/* --- 8. FOOTER --- */
footer {
    background: #000022;
    color: #fff;
    padding: 60px 10% 20px;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-family: var(--font-heading);
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.footer-section p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a:hover {
    color: var(--glow);
    padding-left: 5px;
}

/* Style pour les logos/icônes du footer */
.footer-section.contact p i {
    color: var(--glow);
    margin-right: 10px;
    width: 25px;
    text-align: center;
    font-size: 1.1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-logo img {
    height: 50px;
    margin-bottom: 15px;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    header { 
        flex-direction: column; 
        gap: 15px; 
        align-items: center; /* Centre le logo et la nav horizontalement */
        padding: 1.5rem 0;
    }
    nav ul { 
        flex-direction: column; 
        align-items: center; /* Aligne les icônes parfaitement au centre */
        gap: 15px; 
        padding: 0;
    }
    .hero h2 { font-size: 2rem; }
    
    .hero-student-img {
        display: none; /* Masquer l'image sur mobile pour garder la lisibilité */
    }
    .btn-cta { margin-left: 0; }
}

/* --- 9. CONTACT FORM --- */
.contact-form {
    position: relative;
    padding: 4px; /* Espace pour la bordure lumineuse */
    border-radius: 15px;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden; /* Important pour l'effet */
    z-index: 1;
    border: none; /* On retire la bordure statique */
}

/* Création du fond intérieur (Masque) pour le formulaire */
.contact-form-inner {
    background: rgba(10, 17, 114, 0.8); /* Fond bleu nuit */
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 12px;
    height: 100%;
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--white);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 1rem;
    color: #333;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #333;
    z-index: 10;
}

.password-wrapper input {
    padding-right: 45px !important;
}

.error-message {
    color: #ff7675;
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 500;
    display: none;
    animation: errorAppear 0.3s ease-out;
}

@keyframes errorAppear {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group.checkbox, .form-group.radio {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}
.form-group.checkbox input, .form-group.radio input {
    width: auto;
    margin: 0;
}
.form-group.checkbox label, .form-group.radio label {
    display: inline-block;
    margin: 0;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.btn-submit {
    font-family: var(--font-accent);
    background: linear-gradient(135deg, var(--gold), #f0d700);
    color: var(--primary-blue);
    padding: 14px 35px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #f0d700, var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

body.light-mode .btn-submit {
    box-shadow: 0 4px 15px rgba(10, 17, 114, 0.15);
}

body.light-mode .btn-submit:hover {
    box-shadow: 0 6px 20px rgba(10, 17, 114, 0.25);
}

/* --- 10. BOUTON LANGUE FLOTTANT --- */
.lang-btn {
    font-family: var(--font-accent);
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gold);
    color: var(--primary-blue);
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2000;
    transition: 0.3s;
    font-family: inherit;
}

.lang-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

/* Animation de rotation au clic */
.lang-btn.rotate-anim {
    animation: spin 0.5s ease-in-out;
}

@keyframes spin {
    0% { transform: rotate(0deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1.1); }
}

/* Animation de rebond pour les icônes du menu */
.bounce-anim {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

@keyframes zoomInOut {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* --- 11. STATS BANNER --- */
.stats-banner {
    background-color: rgba(0, 0, 51, 0.8);
    padding: 40px 10%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    text-align: center;
    border-top: 2px solid var(--ultramarine);
    backdrop-filter: blur(5px);
}

.stat-item {
    margin: 20px;
    flex: 1;
    min-width: 150px;
}

.stat-icon {
    font-size: 3rem;
    color: var(--glow);
    margin-bottom: 10px;
    display: block;
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.stat-number {
    font-family: var(--font-accent);
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gold);
}

.stat-label {
    font-size: 1.1rem;
    color: var(--white);
    text-transform: uppercase;
}

/* --- 12. ACTUALITÉS --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.news-grid {
    display: flex;
    overflow-x: auto;
    gap: 30px;
    padding-bottom: 20px;
    scroll-behavior: smooth;
    /* Cacher la barre de défilement */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE */
}

.news-grid::-webkit-scrollbar, .testimonials-grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.news-date {
    display: block;
    font-size: 0.85rem;
    color: var(--glow);
    margin-bottom: 5px;
    font-style: italic;
}

.search-container {
    text-align: center;
    margin-bottom: 30px;
}

#news-search {
    padding: 12px 25px;
    width: 100%;
    max-width: 400px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* --- 13. MODAL / POP-UP --- */
.modal-title {
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-top: 15px;
    display: block;
}

.modal-body-text {
    margin-top: 20px;
    line-height: 1.8;
}

.btn-read-more {
    font-family: var(--font-accent);
    background: var(--gold);
    border: none;
    color: var(--primary-blue);
    padding: 5px 15px;
    margin-top: 15px;
    cursor: pointer;
    border-radius: 20px;
    font-weight: bold;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-read-more:hover {
    background: var(--white);
    transform: translateY(-2px);
}

.modal {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 3000; /* Au-dessus de tout */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8); /* Fond sombre */
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Un peu plus large pour la lecture */
    max-width: 600px;
    border-radius: 10px;
    color: #333;
    position: relative;
    animation: modalOpen 0.4s;
}

@keyframes modalOpen {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Instagram-like news card styling */
.news-grid { flex-wrap: nowrap; }
.news-grid .card { width: 320px; background: var(--card-bg, #0f1724); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 30px rgba(2,6,23,0.6); display: flex; flex-direction: column; }
.news-grid .card .card-header { display: flex; align-items: center; gap: 12px; padding: 12px; }
.news-grid .card .card-header .avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: 0 0 40px; }
.news-grid .card .card-header .avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.news-grid .card .card-header .meta { display:flex; flex-direction:column; }
.news-grid .card .card-header .meta .name { font-weight:700; font-size:0.95rem; color:var(--white); }
.news-grid .card .card-header .meta .date { font-size:0.8rem; color:var(--glow); }

.news-grid .card .card-img-top { height: 340px; object-fit: cover; }
.news-grid .card .card-body { padding: 12px; display:flex; flex-direction:column; gap:8px; }
.news-grid .card .actions { display:flex; gap:8px; align-items:center; }
.news-grid .card .actions .action-btn { background:transparent; border:none; color:var(--white); cursor:pointer; font-size:1.1rem; padding:6px; }
.news-grid .card .likes { font-weight:700; color:var(--white); }
.news-grid .card .caption { color:var(--white); font-size:0.95rem; line-height:1.3; }

/* Facebook-like poll styling */
.poll-facebook { max-width: 560px; background: var(--card-bg, #0f1724); padding: 12px; border-radius: 10px; color: var(--white); box-shadow: 0 6px 20px rgba(2,6,23,0.6); }
.poll-facebook .poll-title { font-weight:700; margin-bottom:8px; }
.poll-facebook .poll-options { display:flex; flex-direction:column; gap:8px; }
.poll-facebook .poll-option { display:flex; gap:12px; align-items:center; }
.poll-facebook .poll-option button.option-btn { flex:1; padding:10px 12px; border-radius:8px; border:1px solid rgba(255,255,255,0.06); background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)); color:var(--white); cursor:pointer; text-align:left; }
.poll-facebook .poll-option .progress-wrap { width:120px; display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.poll-facebook .progress { width:100%; height:10px; background:rgba(255,255,255,0.08); border-radius:999px; overflow:hidden; }
.poll-facebook .progress-bar { height:100%; background:linear-gradient(90deg,#1877f2,#00a2ff); width:0%; transition:width .5s ease; }
.poll-facebook .count { font-size:0.9rem; color:var(--white); }
.poll-facebook .voted { opacity:0.7; }

/* Responsive tweaks */
@media (max-width: 800px) {
    .news-grid { gap: 18px; }
    .news-grid .card { width: 260px; }
    .news-grid .card .card-img-top { height: 260px; }
}

/* Like button state */
.btn-like.liked { color: #e0245e; }
.btn-like.liked i { color: #e0245e; }
.btn-like i.fa-beat { transform-origin: center; }

.comments-count { margin-left: 12px; color: var(--glow); font-size: 0.9rem; }

.modal-content .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.modal-content .actions .action-btn {
    transition: all 0.2s ease;
    padding: 8px 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-content .actions .action-btn:hover {
    transform: scale(1.1);
    color: var(--gold);
}

.modal-content .actions .action-btn.liked {
    color: #e0245e;
}

    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

/* Ajustement pour le texte long dans la modal */
.modal-content p,
.modal-content #proviseur-full-msg {
    max-height: 60vh; /* Limite la hauteur du texte */
    white-space: pre-line; /* Respecte les sauts de ligne du dictionnaire JS */
    overflow-y: auto; /* Ajoute un ascenseur si le texte dépasse */
    padding-right: 10px; /* Espace pour l'ascenseur */
    line-height: 1.8;
    text-align: justify;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--primary-blue);
}

/* --- 14. SURBRILLANCE RECHERCHE --- */
.highlight {
    background-color: var(--ultramarine);
    color: var(--white);
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

.news-grid .card {
    /* S'assurer que les cartes ont une taille fixe pour le carrousel */
    min-width: 300px;
    flex: 0 0 300px;
}

/* --- 14. FORMULAIRES ET STATUTS --- */
.contribution-header {
    font-family: var(--font-heading);
    color: var(--white);
}

.contribution-badge {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid var(--gold);
}

.contribution-card {
    max-width: 800px;
    margin: 0 auto;
}

.department-alert {
    display: none;
    margin-bottom: 15px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 77, 77, 0.15);
    color: #ffb3b3;
    border: 1px solid #ff4d4d;
    font-weight: 600;
}

.department-reminder {
    margin-bottom: 15px;
}

.submission-form {
    margin-top: 5px;
}

.submission-form-label {
    color: var(--white);
}

.submission-form-input,
.submission-form-select {
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
}

.submission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.submission-file-input {
    width: 100%;
    padding: 10px;
    color: white;
}

.submission-submit {
    margin-top: 20px;
}

.contact-status {
    margin-bottom: 15px;
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.consent-label {
    font-size: 0.85rem;
    opacity: 0.9;
    cursor: pointer;
}

.poll-chart-wrapper {
    max-width: 400px;
    margin: 20px auto;
}

.poll-list-wrapper {
    margin-top: 15px;
}

.poll-item {
    border-left: 3px solid var(--gold);
    cursor: pointer;
}

.poll-item .poll-meta {
    font-size: 0.8rem;
}

.poll-item .btn-sm {
    background: var(--gold);
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
}

.filter-wrapper {
    margin-bottom: 2rem;
}

.lightbox-close {
    color: white;
    margin: 20px;
}

.lightbox-image {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border: 3px solid var(--gold);
    border-radius: 10px;
    margin-top: 5vh;
}

.lightbox-caption {
    text-align: center;
    color: white;
    margin-top: 15px;
    font-family: var(--font-accent);
    font-weight: bold;
}

.footer-title {
    margin-bottom: 10px;
}

/* --- 15. UTILITAIRES DIVERS --- */
.logout-link {
    color: var(--gold);
}

.page-title {
    font-family: var(--font-heading);
    color: var(--white);
}

.stat-icon-glow {
    color: var(--glow);
}

.stat-icon-gold {
    color: var(--gold);
}

/* --- 16. FEATURES SECTION --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item {
    background: transparent;
    padding: 33px; /* +3px pour bordure */
    border-radius: 10px;
    transition: 0.3s;
    border: none;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--glow);
    margin-bottom: 20px;
}

.feature-item h3 {
    margin-bottom: 15px;
    color: var(--glow);
}

/* --- 17. SECTION TÉMOIGNAGES (DÉFILEMENT INFINI) --- */
.testimonials-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
}

.testimonials-grid {
    display: flex;
    width: max-content;
    gap: 30px;
    animation: marquee-testimonials 40s linear infinite;
}

.testimonials-wrapper:hover .testimonials-grid {
    animation-play-state: paused;
}

@keyframes marquee-testimonials {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.testimonials-grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.testimonial-card {
    background: transparent;
    color: #333;
    padding: 33px; /* +3px pour bordure */
    border-radius: 10px;
    position: relative;
    min-width: 350px;
    flex: 0 0 350px;
    z-index: 1;
    overflow: hidden;
    border: none; /* La bordure est gérée par l'effet lumineux */
}

/* Correction du conflit : Le guillemet décoratif est déplacé sur le paragraphe */
/* Le ::before du .testimonial-card est maintenant utilisé pour l'effet de bordure lumineuse */
.testimonial-card p::before {
    content: "\201C"; /* Guillemet décoratif */
    font-size: 4rem;
    color: var(--ultramarine);
    position: absolute; /* Positionné par rapport au paragraphe */
    top: -10px;
    left: 10px;
    font-family: serif;
    opacity: 0.5;
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 20px;
}

.author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author img {
    border-radius: 50%;
    border: 2px solid var(--primary-blue);
}

.author span {
    font-weight: bold;
    color: var(--primary-blue);
}

/* --- 18. MOT DU PROVISEUR --- */
.proviseur-section {
    background-color: rgba(255, 255, 255, 0.05); /* Fond légèrement différent */
}

.proviseur-content {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    align-items: center;
    justify-content: center;
}

.proviseur-img img {
    border-radius: 50%;
    border: 4px solid var(--gold);
    width: 350px;
    height: 350px;
    object-fit: cover;
    animation: appearSmooth 1.5s ease-out forwards;
}

@keyframes appearSmooth {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.proviseur-text {
    flex: 1;
    min-width: 300px;
}

.proviseur-name {
    color: var(--glow);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* --- 19. LOCALISATION --- */
.localisation-section {
    padding-bottom: 50px;
    text-align: center;
}

.localisation-section .section-title {
    left: auto;
    transform: none;
}

.map-container {
    width: 100%;
    max-width: 900px;
    height: auto; /* Ajusté pour contenir le padding */
    aspect-ratio: 16/9; /* Ratio vidéo */
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    padding: 4px; /* Espace bordure */
    border: none; /* Retrait bordure statique */
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px; /* Arrondi interne */
    position: relative;
    z-index: 2;
    filter: grayscale(20%) contrast(1.2); /* Petit effet stylé */
}

.school-address {
    margin-top: 25px;
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: bold;
}

.btn-directions {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    background-color: var(--primary-blue);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-directions:hover {
    background-color: var(--gold);
    color: var(--primary-blue);
    transform: translateY(-5px);
}

/* --- 27. VIDÉO PRÉSENTATION PROFESSIONNELLE --- */
.video-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    padding: 5px; /* Épaisseur de la bordure lumineuse */
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-container video {
    width: 100%;
    height: auto;
    max-height: 75vh; /* Empêche la vidéo d'être trop haute sur les écrans PC */
    display: block;
    border-radius: 15px;
    position: relative;
    z-index: 2;
    object-fit: contain; /* Assure que toute la vidéo est visible sans rognage */
    background-color: #000;
}

/* --- 20. BOUTON RETOUR EN HAUT --- */
#back-to-top {
    position: fixed;
    bottom: 80px; /* Au-dessus du bouton de langue */
    right: 20px;
    z-index: 1999;
    width: 45px;
    height: 45px;
    border: none;
    background-color: var(--gold);
    color: var(--glow);
    border: 2px solid var(--gold);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--ultramarine);
    color: var(--white);
    transform: translateY(-5px);
}

/* --- 21. HISTORIQUE ADMINISTRATION (TIMELINE) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

/* La ligne verticale */
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--gold);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

/* Placer les items à gauche ou à droite */
.timeline-item:nth-child(odd) { left: 0; text-align: right; }
.timeline-item:nth-child(even) { left: 50%; text-align: left; }

/* Le point sur la ligne */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--white);
    border: 4px solid var(--gold);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.3s ease;
}
.timeline-item:nth-child(even)::after { left: -10px; }

.timeline-content {
    padding: 23px; /* +3px pour la bordure */
    /* Fond déplacé vers ::after pour l'effet */
    background: transparent;
    color: var(--white);
    border: none;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.timeline-date { color: var(--glow); font-weight: bold; display: block; margin-bottom: 5px; }
.timeline-content h4 { margin: 0 0 5px 0; color: var(--white); }
.timeline-content p { margin: 0; font-style: italic; color: #eee; }
.timeline-grade { display: block; font-size: 0.85rem; color: #ccc; margin-top: 5px; }

/* Animation d'apparition */
.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Effet de survol doré sur l'historique */
.timeline-item:hover .timeline-content {
    transform: scale(1.05);
    border: 1px solid var(--gold);
}

.timeline-item:hover::after {
    background-color: var(--gold);
    transform: scale(1.2);
}

/* Lumière circulante inspirée du style "Firebase" - FORTE ET VISIBLE */
.timeline-content::before {
    content: '';
    position: absolute;
    inset: -2px; /* tout autour de la boîte */
    border-radius: 6px;
    padding: 2px;
    background: linear-gradient(90deg, 
        rgba(255,215,0,0) 0%,
        rgba(255,215,0,0.6) 25%,
        rgba(255,215,0,0.8) 50%,
        rgba(255,215,0,0.6) 75%,
        rgba(255,215,0,0) 100%
    );
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    animation: borderShine 3s linear infinite;
}

/* Animation : lumière qui circule */
@keyframes borderShine {
    0% { transform: rotate(0deg); opacity: 0.3; filter: blur(4px); }
    50% { opacity: 1; filter: blur(8px); }
    100% { transform: rotate(360deg); opacity: 0.3; filter: blur(4px); }
}

/* Toujours animer, pas besoin de .visible */
.timeline-content::before {
    animation: borderShine 3s linear infinite !important;
}

/* Au survol, accélérer */
.timeline-item:hover .timeline-content::before {
    animation-duration: 1.5s !important;
    filter: blur(2px) !important;
}

/* Assurer que le contenu textuel reste au-dessus */
.timeline-content > * {
    position: relative;
    z-index: 2;
}

/* --- 22. FORMATIONS SPECIFIC --- */
.formations-intro {
    text-align: center;
    margin-bottom: 50px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.btn-download {
    display: inline-block;
    background-color: var(--gold);
    border: 2px solid var(--gold);
    color: var(--primary-blue);
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    margin-top: 20px;
    transition: 0.3s;
}

.btn-download:hover {
    background-color: var(--ultramarine);
    color: var(--white);
}

.cycle-container {
    text-align: center;
    margin: 60px 0 30px;
}

.cycle-title {
    display: inline-block;
    color: var(--glow);
    font-size: 1.8rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.cycle-desc {
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
    color: #ddd;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.card-body h4 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-weight: bold;
}

/* --- 23. HERO FORMATIONS --- */
.hero-formations {
    position: relative;
    padding: 4px; /* Espace bordure */
    border-radius: 15px;
    margin-bottom: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 1;
}

@keyframes heroImageEntrance {
    from {
        transform: scale(1.1);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hero-bg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    position: relative;
    z-index: 2;
    animation: heroImageEntrance 1.5s ease-out forwards;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    border-radius: 12px;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
    z-index: 4;
}

.hero-formations .section-title {
    margin-bottom: 30px; /* Espace entre le titre et le texte en dessous */
}

.hero-formations .formations-intro {
    margin-bottom: 0;
}

/* --- REMPLACEMENT EFFET LUMINEUX PAR BORDURE STATIQUE --- */
.contact-form,
.map-container,
.about-content,
.hero-formations,
.card,
.feature-item,
.testimonial-card,
.timeline-content {
    background: var(--glass);
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Fonds internes pour les nouvelles cartes (::after) */
/* S'assurer que le contenu passe au-dessus */
.card > *, .feature-item > *, .testimonial-card > *, .timeline-content > *, .contact-form > *, .about-content > * {
    position: relative;
    z-index: 2;
}

.card::after {
    content: ''; position: absolute; inset: 3px; border-radius: 8px;
    background: rgba(10, 17, 114, 0.7); z-index: 0; /* Fond bleu nuit vitré */
    backdrop-filter: blur(10px);
}

.about-content::after {
    content: ''; position: absolute; inset: 3px; border-radius: 12px;
    background: rgba(5, 5, 16, 0.85); z-index: 0;
    backdrop-filter: blur(15px);
}

.feature-item::after {
    content: ''; position: absolute; inset: 3px; border-radius: 8px;
    background: rgba(10, 17, 114, 0.4); /* Fond sombre vitré */
    backdrop-filter: blur(5px); z-index: 0;
}

.testimonial-card::after {
    content: ''; position: absolute; inset: 3px; border-radius: 8px;
    background: var(--white); z-index: 0; /* Fond blanc pour les témoignages */
}

.timeline-content::after {
    content: ''; position: absolute; inset: 3px; border-radius: 4px;
    background: radial-gradient(circle at 50% 0%, var(--glow) 0%, var(--ultramarine) 100%);
    z-index: 0;
}
.contact-form::after {
    content: ''; position: absolute; inset: 4px; background: #050510; border-radius: 12px; z-index: 0;
}

/* --- 24. BOUTON THÈME & MODE CLAIR --- */
.theme-btn {
    position: fixed;
    bottom: 140px; /* Au-dessus du bouton "Retour en haut" (80px) et langue (20px) */
    right: 20px;
    width: 45px;
    height: 45px;
    border: none;
    background-color: var(--primary-blue);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.theme-btn:hover {
    transform: scale(1.1);
    background-color: var(--gold);
    color: var(--primary-blue);
}

/* --- STYLES DU MODE CLAIR (LIGHT MODE) --- */
body.light-mode {
    background: #f4f6f8;
    color: var(--primary-blue);
}

/* Titres en mode clair */
body.light-mode .section-title,
body.light-mode h2, body.light-mode h3, body.light-mode h4 {
    color: var(--ultramarine);
}


/* Header en mode clair */
body.light-mode header.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(10, 17, 114, 0.1);
}

body.light-mode header.scrolled nav a,
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot {
    0%, 60%, 100% { 
        transform: translateY(0); 
        opacity: 0.3; 
    }
    30% { 
        transform: translateY(-5px); 
        opacity: 1; 
    }
}

/* --- SMS NOTIFICATION (TOAST) --- */


body.light-mode header.scrolled nav a,
body.light-mode header.scrolled .logo span,
body.light-mode header.scrolled nav a i {
    color: var(--ultramarine);
}

/* Garder le texte blanc sur le Hero (image sombre) même en mode clair */
body.light-mode header:not(.scrolled) nav a,
body.light-mode header:not(.scrolled) .logo span {
    color: #fff;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Fix : Garder le texte de la bannière d'accueil en blanc même en mode clair */
body.light-mode .hero h2, 
body.light-mode .hero p {
    color: #ffffff;
}

/* Sections et Contenus sur fond clair */
body.light-mode .about-content,
body.light-mode .feature-item::after {
    background: rgba(255, 255, 255, 0.9);
    /* border géré par l'effet lumineux */
    color: var(--primary-blue);
}

/* Contact Form en mode clair avec bordure lumineuse */
body.light-mode .contact-form::after {
    background: #fff;
}

body.light-mode .form-group label {
    color: var(--ultramarine);
    font-weight: bold;
}

body.light-mode .card {
    /* background: #fff; // Le fond est déjà géré par .card::after */
    border: 1px solid rgba(18, 10, 143, 0.1);
}

body.light-mode .card {
    color: #333;
}

body.light-mode .card::after {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .stats-banner {
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 2px solid var(--gold);
}
body.light-mode .stat-label { color: var(--primary-blue); }
body.light-mode .stat-number { text-shadow: none; color: var(--ultramarine); }

body.light-mode .timeline-content {
    background: transparent;
    color: var(--primary-blue);
    border: none;
}
body.light-mode .timeline-content::after {
    background: #fff;
}
body.light-mode .timeline-content h4 { color: var(--primary-blue); }
body.light-mode .timeline-content p { color: var(--primary-blue); }
body.light-mode .timeline-grade { color: var(--ultramarine); opacity: 0.8; }
body.light-mode .timeline-date {
    color: var(--ultramarine);
}

/* Textes spécifiques formations en mode clair */
body.light-mode .cycle-title {
    color: var(--ultramarine);
    border-bottom: 2px solid var(--gold);
}
body.light-mode .cycle-desc {
    color: var(--primary-blue);
}
body.light-mode .card-body ul li {
    color: var(--primary-blue);
}

body.light-mode footer {
    background: #fff;
    color: var(--primary-blue);
    border-top: 2px solid var(--gold);
}
body.light-mode .footer-section h3 { text-shadow: none; color: var(--primary-blue); }
body.light-mode .footer-section p, 
body.light-mode .footer-bottom { color: var(--primary-blue); }

/* Témoignages en mode clair */
body.light-mode .testimonial-card {
    border: none;
    color: var(--primary-blue);
}
body.light-mode .testimonial-card::after {
    background: #fff;
}

/* Localisation en mode clair */
body.light-mode .map-container {
    background: transparent; /* Géré par l'effet lumineux */
    padding: 4px;
    border: none;
}
body.light-mode .map-container iframe {
    border-radius: 12px;
}
body.light-mode .map-container iframe {
    filter: none;
    box-shadow: none;
}

/* Adresse en mode clair */
body.light-mode .school-address {
    color: var(--ultramarine);
}

/* --- FIX VISIBILITÉ DROPDOWNS (SELECT/OPTION) --- */
select option {
    background-color: #050510; /* Fond sombre pour le mode nuit */
    color: #ffffff;
}

body.light-mode select {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 1px solid rgba(10, 17, 114, 0.2) !important;
}

body.light-mode select option {
    background-color: #ffffff;
    color: #333333;
}

/* --- RESPONSIVE MAP MOBILE --- */
@media (max-width: 768px) {
    /* Cible le conteneur en mode normal ET en mode clair */
    .map-container, body.light-mode .map-container {
        width: 100%;
        height: 300px; /* Hauteur rectangulaire adaptée au mobile */
        border-radius: 15px; /* Coins légèrement arrondis au lieu du cercle */
    }

    .localisation-section .section-title {
        font-size: 1.5rem; /* Réduit la taille du titre sur mobile */
    }
}

/* --- 25. ASSISTANT IA GEMINI FLOTTANT --- */
.ai-btn {
    position: fixed;
    bottom: 200px; /* Positionné au-dessus des autres boutons flottants */
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    /* Dégradé style Gemini */
    background: linear-gradient(135deg, #4285F4, #9B72CB, #D96570);
    color: white;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2000;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-btn:hover {
    transform: scale(1.1) rotate(15deg);
}

.ai-chat-box {
    position: fixed;
    bottom: 90px; /* Juste au-dessus du footer ou boutons */
    right: 80px; /* Décalé vers la gauche par rapport aux boutons */
    width: 320px;
    height: 450px;
    background: rgba(10, 17, 114, 0.95);
    border: 1px solid var(--gold);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2001;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Effet rebond */
    backdrop-filter: blur(10px);
}

.ai-chat-box.active {
    transform: scale(1);
}

.chat-header {
    background: linear-gradient(90deg, var(--primary-blue), var(--ultramarine));
    padding: 12px 15px;
    color: var(--gold);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.close-chat { background: none; border: none; color: white; cursor: pointer; font-size: 1rem; }

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message { padding: 8px 12px; border-radius: 12px; font-size: 0.9rem; max-width: 80%; line-height: 1.4; }
.bot-message { background: rgba(255,255,255,0.1); color: white; align-self: flex-start; border-bottom-left-radius: 2px; }
.user-message { background: var(--gold); color: var(--primary-blue); align-self: flex-end; border-bottom-right-radius: 2px; font-weight: 500; }

.chat-input {
    padding: 10px;
    display: flex;
    gap: 5px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.chat-input input { flex: 1; padding: 10px; border-radius: 20px; border: none; outline: none; font-size: 0.9rem; }
.chat-input button { background: var(--gold); color: var(--primary-blue); border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.3s; }
.chat-input button:hover { transform: scale(1.1); background: var(--white); }

/* Adaptation Mode Clair */
body.light-mode .ai-chat-box { background: white; border-color: var(--ultramarine); }
body.light-mode .chat-header { color: white; } /* Header reste bleu */
body.light-mode .bot-message { background: #f1f1f1; color: #333; }
body.light-mode .chat-input input { background: #f1f1f1; color: #333; }

/* Indicateur de frappe IA (3 points) */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 15px !important; /* Force le padding */
    width: fit-content;
}

.typing-indicator span {
    display: block;
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: typing-dot 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot {
    0%, 60%, 100% { 
        transform: translateY(0); 
        opacity: 0.3; 
    }
    30% { 
        transform: translateY(-5px); 
        opacity: 1; 
    }
}

/* --- SMS NOTIFICATION (TOAST) --- */
.sms-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 320px;
    background: rgba(5, 5, 16, 0.95);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--gold);
    z-index: 3000;
    animation: slideInLeft 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.sms-icon { color: var(--gold); font-size: 1.5rem; }
.sms-content strong { display: block; color: var(--gold); font-size: 0.8rem; text-transform: uppercase; }
.sms-content p { font-size: 0.85rem; color: white; margin: 0; line-height: 1.3; }
.sms-toast button {
    background: none; border: none; color: #aaa; cursor: pointer; font-size: 1.2rem;
    position: absolute; top: 5px; right: 10px;
}

/* --- 26. PAGE LOGIN --- */
body.login-page {
    position: relative;
    overflow-x: hidden; /* Empêche le défilement horizontal dû au zoom */
}

/* Image de fond animée avec effet Zoom In/Out */
body.login-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/fond-connexion.jpeg') no-repeat center center/cover;
    z-index: -2;
    animation: zoomInOut 20s infinite alternate;
}

/* Filtre sombre pour la lisibilité */
body.login-page::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

/* --- PAGE CONTACT --- */
body.contact-page {
    position: relative;
    overflow-x: hidden;
}

/* Image de fond animée Pti.png */
body.contact-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/Pti.png') no-repeat center center/cover;
    z-index: -2;
    animation: zoomInOut 20s infinite alternate;
}

/* Filtre sombre pour la lisibilité du formulaire */
body.contact-page::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.logsin-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 5%;
    min-height: 80vh;
}

.login-container {
    width: 100%;
    max-width: 900px;
    background: rgba(10, 17, 114, 0.2);
    padding: 40px;
    border-radius: 15px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.login-container::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #050510;
    border-radius: 13px;
    z-index: -1;
}

.login-header { text-align: center; margin-bottom: 30px; }
.login-header h2 { font-size: 2.2rem; color: var(--gold); margin-bottom: 10px; }

/* --- 28. LAYOUT TABLEAUX DE BORD (DASHBOARD PROFESSIONNEL) --- */
.dashboard-container {
    max-width: 1300px;
    margin: 140px auto 50px;
    padding: 0 30px;
}

.dashboard-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 17, 114, 0.3);
    padding: 35px;
    border-radius: 15px;
    border-left: 5px solid var(--gold);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.dash-stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 35px;
    align-items: start;
}

.dash-section {
    background: rgba(10, 17, 114, 0.2);
    padding: 30px;
    border-radius: 15px;
}

.dash-section-header h3 {
    color: var(--gold);
    margin-bottom: 25px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,215,0,0.2);
    padding-bottom: 15px;
}

.upload-zone {
    border: 2px dashed var(--glow);
    padding: 50px 20px;
    text-align: center;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.03);
    transition: 0.3s;
}

.upload-zone:hover {
    border-color: var(--gold);
    background: rgba(65, 105, 225, 0.1);
}

.stat-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(65, 105, 225, 0.2);
    border: 1px solid var(--glow);
}

/* --- ANIMATION DE RÉVÉLATION (SYNC) --- */
.reveal-element {
    opacity: 0;
    transform: translateX(-150px); /* Départ plus prononcé à gauche */
    transition: opacity 1.2s ease-out, transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none; /* Empêche de bloquer les clics tant qu'invisible */
}

.reveal-element.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Dashboard spécifiques en mode clair */
body.light-mode .dashboard-welcome {
    background: #fff;
    border: 1px solid rgba(10, 17, 114, 0.1);
}
body.light-mode .dashboard-welcome h2 {
    color: var(--primary-blue) !important;
}
body.light-mode .dash-stat-card,
body.light-mode .dash-section {
    background: #ffffff;
    border: 1px solid rgba(10, 17, 114, 0.1);
}
body.light-mode .dash-info h3 {
    color: var(--primary-blue);
}

.admin-module {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    padding-top: 16px;
}

.admin-panel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-panel-tab {
    border: 1px solid rgba(255, 215, 0, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}

.admin-panel-tab.active {
    background: var(--gold);
    color: #07112f;
    font-weight: 700;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--white);
    font-size: 0.95rem;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.admin-form textarea {
    min-height: 100px;
    resize: vertical;
}

.admin-image-preview {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.admin-image-preview[hidden] {
    display: none;
}

.admin-image-preview img {
    width: 140px;
    height: 92px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.25);
}

.admin-content-note {
    grid-column: 1 / -1;
    padding: 10px 12px;
    border-left: 3px solid var(--gold);
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    border-radius: 8px;
    font-size: 0.9rem;
}

.admin-content-note[hidden] {
    display: none;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-content-list-block {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-content-list-block h4 {
    margin-bottom: 10px;
    color: var(--white);
}

.admin-content-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.admin-summary-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.admin-summary-card strong {
    display: block;
    font-size: 1.15rem;
    margin-top: 4px;
}


/* --- FILTRAGE (ÉQUIPE & ALBUM) --- */
.filter-wrapper {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--glow);
    background: rgba(255,255,255,0.05);
    color: var(--white);
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-accent);
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--glow);
    transform: translateY(-2px);
    color: white;
}
